package com.slz3.business.module.drawManagement.draUserNumber.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.drawManagement.draUserNumber.domain.DraUserNumber;
import com.slz3.business.module.drawManagement.draUserNumber.domain.DraUserNumberCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class DraUserNumberResController {

    static Mono<ServerResponse> add(ServerRequest req, DraUserNumber draUserNumber) {
        if (DraUserNumberResUnsafeValid.add(req, draUserNumber)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.add_$DraUserNumberUpdateLock(req, draUserNumber);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, DraUserNumberCondition draUserNumberCondition) {
        if (DraUserNumberResUnsafeValid.delete(req, draUserNumberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.delete_$DraUserNumberUpdateLock(req, draUserNumberCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, DraUserNumber draUserNumber) {
        if (DraUserNumberResUnsafeValid.modify(req, draUserNumber)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.modify_$DraUserNumberUpdateLock(req, draUserNumber);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (DraUserNumberResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (DraUserNumberResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.info_$DraUserNumberUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (DraUserNumberResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, DraUserNumberCondition draUserNumberCondition) {
        //
        if (DraUserNumberResUnsafeValid.auditSubmit(req, draUserNumberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.auditSubmit_$DraUserNumberUpdateLock(req, draUserNumberCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, DraUserNumberCondition draUserNumberCondition) {
        if (DraUserNumberResUnsafeValid.audit(req, draUserNumberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.audit_$DraUserNumberUpdateLock(req, draUserNumberCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, DraUserNumberCondition draUserNumberCondition) {
        if (DraUserNumberResUnsafeValid.auditReject(req, draUserNumberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.auditReject_$DraUserNumberUpdateLock(req, draUserNumberCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, DraUserNumberCondition draUserNumberCondition) {
        if (DraUserNumberResUnsafeValid.usingEnable(req, draUserNumberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.usingEnable_$DraUserNumberUpdateLock(req, draUserNumberCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, DraUserNumberCondition draUserNumberCondition) {
        if (DraUserNumberResUnsafeValid.usingDisable(req, draUserNumberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraUserNumberResAtomic.usingDisable_$DraUserNumberUpdateLock(req, draUserNumberCondition);
        }
    }

}
